package com.mtons.mblog.web.controller.site;

import com.mtons.mblog.modules.service.NavService;
import com.mtons.mblog.modules.service.ToolService;
import com.mtons.mblog.web.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 常用工具.
 * @author yuzhong
 * @date 2019/2/27 16:29
 */
@Controller
public class ToolController extends BaseController {

    @Autowired
    private ToolService toolService;

    @Autowired
    private NavService navService;

    /**
     * 常用工具及导航列表
     * @return
     */
    @RequestMapping("/tools")
    public String view(ModelMap model) {
        model.put("tools", toolService.findToolsAll());
        model.put("navs", navService.findNavsAll());
        return view(Views.TOOL);
    }

}
